import axios from '@/libs/request/axios'
import QS from 'qs';
//  查询单笔罚息列表数据
export const findPenaltyExemptList = (params) => {
    return axios.request({
        url: `/contractManage/findPenaltyExempt/findPenaltyExemptList`,
        method: 'POST',
        data: params,
    })
};
//  查询已激活合同列表数据
export const getBasicCostList = (params) => {
    return axios.request({
        url: `/contractBasic/basicCostExemptBillInfo/getBasicCostList`,
        method: 'POST',
        data: params
    })
};

// 详情 每期罚息 table basicCanaelInfo/getBasicPenaltyInterest
export const getBasicPenaltyInterest = (contractNo) => {
    return axios.request({
        url: `/contractBasic/basicCostExemptBillInfo/getBasicPenaltyInterest`,
        data: QS.stringify({contractNo: contractNo}, {arrayFormat: 'repeat'}),
        // data: QS.stringify({ contractNo }, { arrayFormat: 'repeat' }),
        method: 'post',
        headers: {'content-type': 'application/x-www-form-urlencoded'},
    })
};
//  保存单笔罚息数据
export const savePenaltyExempt = (params) => {
    return axios.request({
        url: `/contractManage/findPenaltyExempt/savePenaltyExempt`,
        method: 'POST',
        data: params,
    })
};
// 获取单笔罚息数据
export const getPenaltyExempt = (id) => {
    return axios.request({
        url: '/contractManage/findPenaltyExempt/findPenaltyExemptDetails',
        data: QS.stringify({id: id}, {arrayFormat: 'repeat'}),
        method: 'post',
        headers: {'content-type': 'application/x-www-form-urlencoded'},
    })
};
// 提交单笔罚息数据
export const submitPenaltyExempt = (params) => {
    return axios.request({
        url: '/contractManage/findPenaltyExempt/submitPenaltyExempt',
        data: params,
        method: 'post'
    })
};
// 单笔罚息流程审批
export const approvePenaltyExempt = (params) => {
    return axios.request({
        url: '/contractManage/findPenaltyExempt/approvePenaltyExempt',
        data: params,
        method: 'post'
    })
};
// 删除案件
export const delById = (id, params) => {
    return axios.request({
        url: `/contractManage/findPenaltyExempt/delById/${id}`,
        params: params,
        method: 'delete'
    })
};
//  查询单笔合同限额数据
export const getLimitAmt = () => {
    return axios.request({
        url: `/contractManage/findPenaltyExempt/getLimitAmt`,
        method: 'POST',
    })
};
//  查询总体限额数据
export const getCostExempt = () => {
    return axios.request({
        url: `/contractManage/findPenaltyExempt/getCostExempt`,
        method: 'POST',
    })
};
